package com.moter.demo01.io.in_outputstream.bytearraystream;

import java.io.ByteArrayInputStream;
import java.io.IOException;

public class ByteArrayInputStreamDemo {
    public static void main(String[] args) throws IOException {
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(new byte[]{'m', 'o', 't', 'e', 'r'});
        byte[] bytes = new byte[4];
        byteArrayInputStream.read(bytes);
        System.out.println(new String(bytes));
        byteArrayInputStream.close();
    }
}
